
<c:choose>
<c:when test='<%= tabs2.equals("New") %>'>

<%
List<College> collegesNew = CollegeLocalServiceUtil.getByStatus(0);
SearchContainer searchContainer = new SearchContainer(renderRequest, null, null, SearchContainer.DEFAULT_CUR_PARAM, 5, tabs2URL, null, "");
List newResults = ListUtil.subList(collegesNew, searchContainer.getStart(), searchContainer.getEnd());
int total = collegesNew.size();
searchContainer.setTotal(total);
%>

<center>
<table class="taglib-search-iterator" style="width:100%" cellspacing="0" cellpadding="2">
	<tr class='results-header'>
		<th><liferay-ui:message key="sNo" /></th>
		<th><liferay-ui:message key="college-name" /></th>
		<th><liferay-ui:message key="no-Of-students" /></th>
		<th><liferay-ui:message key="no-Of-staffs" /></th>	
		<th></th>		
	</tr>
<%
for(int i=0; i<newResults.size(); i++){

		College college = (College) newResults.get(i);
		
		String className = ( ( i%2 == 0 ) ? "portlet-section-body results-row" : "portlet-section-body results-row alt"); 
		String classNameHover = className+" hover";%>
		<tr class='<%= className %>'; onmouseout="this.className = '<%=className%>'" onmouseover="this.className = '<%=classNameHover%>'"> 
			
			<td><%= Integer.toString(searchContainer.getStart() + i + 1)%></td>
			<td><%= college.getName() %></td>
			<td><%= college.getNoOfStudents() %></td>
			<td><%= college.getNoOfStaffs() %></td>
			<td>
			<liferay-ui:icon-menu>
				<portlet:actionURL windowState="<%= WindowState.NORMAL.toString() %>" var="viewCollege">
				<portlet:param name="struts_action" value="/ext/registration/campusRegistration" />
				<portlet:param name="<%= Constants.CMD %>" value="viewCollege" />
				<portlet:param name="collegeId" value="<%= String.valueOf(college.getCollegeId()) %>" />
				<portlet:param name="approve" value="1" />
				</portlet:actionURL>
				<liferay-ui:icon image="preview" message="view" url="<%= viewCollege %>" />
			</liferay-ui:icon-menu>
			</td>
		</tr>
		
<%	
}
%>
</table>
</center>
<div class="taglib-search-iterator-page-iterator-bottom">
	<liferay-ui:search-paginator searchContainer="<%= searchContainer %>" />
</div>
</c:when>


<c:when test='<%= tabs2.equals("Approved") %>'>

<%
List<College> collegesApproved = CollegeLocalServiceUtil.getByStatus(1);
SearchContainer searchContainer = new SearchContainer(renderRequest, null, null, SearchContainer.DEFAULT_CUR_PARAM, 5, tabs2URL, null, "");
List approvedResults = ListUtil.subList(collegesApproved, searchContainer.getStart(), searchContainer.getEnd());
int total = collegesApproved.size();
searchContainer.setTotal(total);

%>

<center>
<table class="taglib-search-iterator" style="width:100%" cellspacing="0" cellpadding="2">
	<tr class='results-header'>
		<th><liferay-ui:message key="sNo" /></th>
		<th><liferay-ui:message key="college-name" /></th>
		<th><liferay-ui:message key="no-Of-students" /></th>
		<th><liferay-ui:message key="no-Of-staffs" /></th>	
		<th></th>		
	</tr>
<%
for(int i=0; i<approvedResults.size(); i++){

		College college = (College) approvedResults.get(i);
		
		String className = ( ( i%2 == 0 ) ? "portlet-section-body results-row" : "portlet-section-body results-row alt"); 
		String classNameHover = className+" hover";%>
			<tr class='<%= className %>'; onmouseout="this.className = '<%=className%>'" onmouseover="this.className = '<%=classNameHover%>'"> 
			
			<td><%= Integer.toString(searchContainer.getStart() + i + 1)%></td>
			<td><%= college.getName() %></td>
			<td><%= college.getNoOfStudents() %></td>
			<td><%= college.getNoOfStaffs() %></td>
			
	        <td>
			<liferay-ui:icon-menu>
				<portlet:actionURL windowState="<%= WindowState.MAXIMIZED.toString() %>" var="viewCollege">
				<portlet:param name="struts_action" value="/ext/registration/campusRegistration" />
				<portlet:param name="<%= Constants.CMD %>" value="viewCollege" />
				<portlet:param name="collegeId" value="<%= String.valueOf(college.getCollegeId()) %>" />
				<portlet:param name="approve" value="0" />
				</portlet:actionURL>
				<liferay-ui:icon image="preview" message="View" url="<%= viewCollege %>" />
				<portlet:actionURL windowState="<%= WindowState.MAXIMIZED.toString() %>" var="removeCollege">
				<portlet:param name="struts_action" value="/ext/registration/campusRegistration" />
				<portlet:param name="<%= Constants.CMD %>" value="removeCollege" />
				<portlet:param name="collegeId" value="<%= String.valueOf(college.getCollegeId()) %>" />
				</portlet:actionURL>
				<liferay-ui:icon image="remove" message="Remove" url="<%= removeCollege %>" />
			</liferay-ui:icon-menu>
			</td>
		</tr>
		
<%	
}
%>
</table>
</center>
<div class="taglib-search-iterator-page-iterator-bottom">
	<liferay-ui:search-paginator searchContainer="<%= searchContainer %>" />
</div>
</c:when>


<c:when test='<%= tabs2.equals("Pending") %>'>

<%
List<College> collegesPending = CollegeLocalServiceUtil.getByStatus(2);

SearchContainer searchContainer = new SearchContainer(renderRequest, null, null, SearchContainer.DEFAULT_CUR_PARAM, 5, tabs2URL, null, "");
List pendingResults = ListUtil.subList(collegesPending, searchContainer.getStart(), searchContainer.getEnd());
int total = collegesPending.size();
searchContainer.setTotal(total);

%>

<center>
<table class="taglib-search-iterator" style="width:100%" cellspacing="0" cellpadding="2">
	<tr class='results-header'>
		<th><liferay-ui:message key="sNo" /></th>
		<th><liferay-ui:message key="college-name" /></th>
		<th><liferay-ui:message key="no-Of-students" /></th>
		<th><liferay-ui:message key="no-Of-staffs" /></th>	
		<th></th>		
	</tr>
<%
for(int i=0; i<pendingResults.size(); i++){

		College college = (College) pendingResults.get(i);

		String className = ( ( i%2 == 0 ) ? "portlet-section-body results-row" : "portlet-section-body results-row alt"); 
		String classNameHover = className+" hover";%>
			<tr class='<%= className %>'; onmouseout="this.className = '<%=className%>'" onmouseover="this.className = '<%=classNameHover%>'"> 
			<td><%= Integer.toString(searchContainer.getStart() + i + 1)%></td>
			<td><%= college.getName() %></td>
			<td><%= college.getNoOfStudents() %></td>
			<td><%= college.getNoOfStaffs() %></td>
	        <td>
			<liferay-ui:icon-menu>
				<portlet:actionURL windowState="<%= WindowState.MAXIMIZED.toString() %>" var="viewCollege">
				<portlet:param name="struts_action" value="/ext/registration/campusRegistration" />
				<portlet:param name="<%= Constants.CMD %>" value="viewCollege" />
				<portlet:param name="collegeId" value="<%= String.valueOf(college.getCollegeId()) %>" />
				<portlet:param name="approve" value="2" />
				</portlet:actionURL>
				<liferay-ui:icon image="preview" message="View" url="<%= viewCollege %>" />
				<portlet:actionURL windowState="<%= WindowState.MAXIMIZED.toString() %>" var="approveCollege">
				<portlet:param name="struts_action" value="/ext/registration/campusRegistration" />
				<portlet:param name="<%= Constants.CMD %>" value="approveCollege" />
				<portlet:param name="collegeId" value="<%= String.valueOf(college.getCollegeId()) %>" />
				</portlet:actionURL>
				<liferay-ui:icon image="add_user" message="Approve" url="<%= approveCollege %>" />
			</liferay-ui:icon-menu>
			</td>
		
		</tr>
		
<%	
}
%>
</table>
</center>
<div class="taglib-search-iterator-page-iterator-bottom">
	<liferay-ui:search-paginator searchContainer="<%= searchContainer %>" />
</div>
</c:when>


<c:when test='<%= tabs2.equals("Rejected") %>'>

<%
List<College> collegesRejected = CollegeLocalServiceUtil.getByStatus(3);


SearchContainer searchContainer = new SearchContainer(renderRequest, null, null, SearchContainer.DEFAULT_CUR_PARAM, 5, tabs2URL, null, "");
List rejectedResults = ListUtil.subList(collegesRejected, searchContainer.getStart(), searchContainer.getEnd());
int total = collegesRejected.size();
searchContainer.setTotal(total);

%>

<center>
<table class="taglib-search-iterator" style="width:100%" cellspacing="0" cellpadding="2">
	<tr class='results-header'>
		<th><liferay-ui:message key="sNo" /></th>
		<th><liferay-ui:message key="college-name" /></th>
		<th><liferay-ui:message key="no-Of-students" /></th>
		<th><liferay-ui:message key="no-Of-staffs" /></th>	
		<th></th>		
	</tr>
<%
for(int i=0; i<rejectedResults.size(); i++){

		College college = (College) rejectedResults.get(i);
		
		String className = ( ( i%2 == 0 ) ? "portlet-section-body results-row" : "portlet-section-body results-row alt"); 
		String classNameHover = className+" hover";%>
			<tr class='<%= className %>'; onmouseout="this.className = '<%=className%>'" onmouseover="this.className = '<%=classNameHover%>'"> 
			<td><%= Integer.toString(searchContainer.getStart() + i + 1)%></td>
			<td><%= college.getName() %></td>
			<td><%= college.getNoOfStudents() %></td>
			<td><%= college.getNoOfStaffs() %></td>
	        <td>
			<liferay-ui:icon-menu>
				<portlet:actionURL windowState="<%= WindowState.MAXIMIZED.toString() %>" var="viewCollege">
				<portlet:param name="struts_action" value="/ext/registration/campusRegistration" />
				<portlet:param name="<%= Constants.CMD %>" value="viewCollege" />
				<portlet:param name="collegeId" value="<%= String.valueOf(college.getCollegeId()) %>" />
				<portlet:param name="approve" value="3" />
				</portlet:actionURL>
				<liferay-ui:icon image="preview" message="View" url="<%= viewCollege %>" />
				<portlet:actionURL windowState="<%= WindowState.MAXIMIZED.toString() %>" var="approveCollege">
				<portlet:param name="struts_action" value="/ext/registration/addRegistration" />
				<portlet:param name="<%= Constants.CMD %>" value="approveCollege" />
				<portlet:param name="collegeId" value="<%= String.valueOf(college.getCollegeId()) %>" />
				</portlet:actionURL>
				<liferay-ui:icon image="add_user" message="Approve" url="<%= approveCollege %>" />
			</liferay-ui:icon-menu>
			</td>
		
		</tr>
		
<%	
}
%>
</table>
</center>
<div class="taglib-search-iterator-page-iterator-bottom">
	<liferay-ui:search-paginator searchContainer="<%= searchContainer %>" />
</div>
</c:when>
</c:choose>